export const loginRules = {
  username: {
    rules: [
      { required: true, errorMessage: '账号不能为空' },
      { minLength: 2, errorMessage: '账号长度不能少于2位' },
      { maxLength: 20, errorMessage: '账号长度不能超过20位' },
      { pattern: '^[a-zA-Z0-9_-]+$', errorMessage: '账号只能包含字母、数字和下划线' }
    ]
  },
  password: {
    rules: [
      { required: true, errorMessage: '密码不能为空' },
      { minLength: 6, errorMessage: '密码长度不能少于6位' },
      { maxLength: 20, errorMessage: '密码长度不能超过20位' },
      { pattern: '^(?=.*[A-Za-z])(?=.*\\d).+$', errorMessage: '需包含字母和数字' }
    ]
  }
};